//
// main.cpp for  in /home/gomes_m//RPBaraze
// 
// Made by mickael gomes
// Login   <gomes_m@epitech.net>
// 
// Started on  Fri Sep  6 14:29:29 2013 mickael gomes
// Last update Fri Sep  6 17:11:41 2013 mickael gomes

#include		<cstdlib>
#include		<stdio.h>
#include		"Character.hh"
#include		"CoupDeCoutal.hh"

bool			playerAlive(Character &p1)
{
  if (p1.isAlive())
    std::cout << p1.getName() << " IS VICTORIOUS !!!!" << std::endl;
}

int			main(int ac, char **av)
{
  std::string		name1 = "Baraze";
  std::string		name2 = "Gomes";

  if (ac == 3)
    {
      name1 = av[1];
      name2 = av[2];
    }
  Character		baraze(name1);
  Character		gomes(name2);

  srandom(time(0) * getpid());
  while (12)
    {
      gomes.attack(baraze);
      if (!baraze.isAlive())
	break;
      getchar();
      baraze.attack(gomes);
      if (!gomes.isAlive())
	break;
      getchar();
    }
  playerAlive(baraze);
  playerAlive(gomes);
}
